package pack0619;

/*
 *    2. 打印图形
 *              *
 *          *   *   *
 *      *   *   *   *  *
 * *                       *
 *      *             *
 *          *     *
 *             *
 */
public class ZuoYe2 {
    public static void main(String[] args) {
        for (int i = 0; i < 3; i++) {
            //先打空格
            for (int j = 0; j < 2 - i; j++) {
                System.out.print(" ");
            }
            //打*
            for (int k = 0; k< 2 * i+ 1; k++)
                if (k== 0 || k== 2 * i)
                    System.out.print("*");
                else
                    System.out.print(" ");
            //换行
            System.out.println();
        }
        //下半三角
        for (int i=0;i<2;i++){
            //先打空格
            for (int k=0;k<=i;k++){
                System.out.print(" ");
            }

            //打*
            for (int k=0;k<3-2*i;k++){
                if (k==0||k==3-2*i-1)
                    System.out.print("*");
                else
                    System.out.print(" ");
            }
            //换行
            System.out.println();
        }
    }
}

